#ifndef	_EBM_ENV_H
#define _EBM_ENV_H
#include "sys.h"
#include "ebm_sys.h"
#include "ebm_msg.h"
#include "ebm_net.h"
#include "ebm_passback.h"
#include "ebm_player.h"
#include "ebm_task.h"

#include "app_delay.h"
#include "nstar_light_glint.h"
#include "nstar_hcf4051.h"
extern void sys_log(char* fmt,...);

struct ebm_env{
	unsigned int plat_ip;
	unsigned short plat_port;
	unsigned int rtp_ip;
	unsigned short rtp_port;
	unsigned int passback_ip;
	unsigned short passback_port;
	unsigned char phy_id[6];
	unsigned char source_id[12];
	unsigned char register_1st_time;
    unsigned short passback_tp;
    unsigned short heart_tp;
    unsigned char fm_tp;
    unsigned int fm_fq;
};



extern unsigned short syscfg_plat_port_get(void);
extern unsigned int syscfg_passback_sip_get(void);
extern unsigned short syscfg_passback_port_get(void);

unsigned char ebm_env_get_vol(void);
unsigned char ebm_env_set_vol(unsigned char vol);
unsigned char ebm_env_set_ip(unsigned char *ip);

unsigned char ebm_env_set_platip(unsigned char *ip, unsigned short port);
unsigned char ebm_env_set_backip(unsigned char *ip, unsigned short port);
unsigned char ebm_env_set_sourceid(unsigned char *sourceid);
unsigned char ebm_env_set_trumpet(unsigned char val);
unsigned char ebm_env_get_trumpet(void);
unsigned char ebm_env_set_systime(unsigned int val);


unsigned char ebm_env_get_sourceid(unsigned char *buf, unsigned char buf_len);
unsigned char ebm_env_get_phyid(unsigned char *id, unsigned char len);

unsigned char ebm_env_get_register_1st_time(void);

unsigned int ebm_env_get_sip(void);



unsigned char ebm_env_get_playsta(void);



unsigned char ebm_env_set_heart_tp(unsigned short val);
unsigned short ebm_env_get_heart_tp(void);
unsigned char ebm_env_set_back_tp(unsigned short val);
unsigned short ebm_env_get_back_tp(void);
unsigned char ebm_env_set_fm_tp(unsigned short val);


void ebm_update_local_ip(void);

unsigned int oem_get_manufacture(void);
unsigned int oem_get_hard_ver(void);
unsigned int oem_get_flashoem_ver(void);
unsigned int oem_get_soft_ver(void);


unsigned int app_get_systime(void);
#define ebmdbg_command(...) do{}while(0)
#define ebmdbg_rec(...) do{}while(0)
#define ebmdbg_fm(...) do{}while(0)
#define ebmdbg_board(...) do{}while(0)


unsigned char ebm_env_get_volmax(void);
unsigned char ebm_set_fmfq(unsigned int val);
unsigned int ebm_get_fmfq(void);

#endif
